-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: GH4080, int conversion of underlying series to float needs updating in parent frame #4081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -666,11 +667,17 @@ def _get_item_cache(self, item): | |||
values = self._data.get(item) | |||
res = self._box_item_values(item, values) | |||
cache[item] = res | |||
res._cacher = (item,weakref.ref(self)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i envy your ability to see this solution so fast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah this was basically my solution on the other issue (which took a while to figure out); but was replaced with a slightly different form of considation (I this one is actually better though)
Sigh, more signs that pandas is due for a major internal refactor |
yep....you want to include this or wait till 0.13 (where even after Series refactor I think this still might be needed)? |
…ing in parent frame DOC: update release notes
@wesm ? |
Hold on just a minute here. The Series I'm seeing worse behavior on my machine:
Don't approve of hacking around this issue or modifying an ndarray's dtype in place. |
your example shows the current behavior (this with PR)
in place is ok for int->float, but doesn't work if its an object array (see #3217), but that's not an issue here |
I don't understand why it needs to upcast? |
in this particular case it doesn't in thery, but and this is contrived too....if we could avoid the direct series updateing (
|
@wesm I guess let's push to 0.13....assume you want to get 0.12 out the door....:) |
ok i'll push to 0.13/0.12.1 |
closing in favor of #3482 which addresses this |
closes #4080
essentially a variation on #3970
here block consolidation and cache is not the issue,
rather the dtype of the series is int, and as a result of the update (directly on the series)
changes dtype to float (which is fine)
BUT the parent still has this in an Int Block
this PR essentially creates an Observer Pattern thru a weakref
that allows notification of chanes (propogated back to the BlockManager)
which can then take action if needed